<%@ page import="java.util.*"%>
<%@ page import="objects.*"%>
<%@ page import="Domain.UserClient.ButtonsFunctions"%>
<%@page import="Domain.DataManager"%>

<%
	DataManager dm = (DataManager) (session.getAttribute("dm"));
	ButtonsFunctions bf = (ButtonsFunctions) (session
			.getAttribute("bf"));

	if (dm == null || dm.getUserStatus() == DataManager.DISCONNECTED) {
		response.sendRedirect("Welcome.jsp");
	} else {
%>

<%
		String nameOfThread = dm.getCurrThread();
		String title = request.getParameter("title");
		
		bf.processRemoveMessage(nameOfThread, title);

		if (dm.getSuccessOrFailure() != DataManager.SUCCESS)
			response.sendRedirect("ErrorPage.html");
		else
			response.sendRedirect("ChoosePost.jsp?nameOfThread="
					+ nameOfThread);
%>

<%
	}
%>